<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>申请提现</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <link href="/static/usr/xcfaka/css/user_mobile.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/static/usr/xcfaka/css/iconfont.css">
    <script src="/static/usr/xcfaka/js/jquery-1.8.3.min.js"></script>
    <script src="/static/tpl/xcfaka/js/layer/layer.js"></script>
</head>

<body>
<!-- 顶部 -->
<div class="top">
    <div class="top_con">
        <span>申请提现</span>
    </div>
    <div class="top_con top2" style="padding-bottom:20px;">
        <span><?php echo number_format($apply_money,2,'.','') ?></span><br>可提现金额(不包含当天销售额) (元)
    </div>
</div>
<form name="applyforsettlement" action="/wechat/takecash.php?action=add" method="post" onsubmit="return checkForm()">
    <div class="list_bg">
        <table border="0" cellspacing="0" cellpadding="0" class="tab1">
            <tr>
                <td style="width: 25%;">收款方式</td>
                <td><?php echo $payname; ?></td>
            </tr>
            <tr>
                <td>收款姓名</td>
                <td><?php echo $realname; ?></td>
            </tr>
            <tr>
                <td>收款帐号</td>
                <td><?php echo $alipay ?></td>
            </tr>
            <tr>
                <td>提现金额</td>
                <td><input name="money" type="text" value="<?php echo $apply_money ?>" style="width:50%"> <font>元（需整数）</font></td>
            </tr>
        </table>
    </div>
    <button type="submit" class="btn2">申请提现</button>
</form>
<script>
    function checkForm(){
        var tf=<?php echo $config['takecash_f'] ?>;
        var tt=<?php echo $config['takecash_t'] ?>;
        var ts=<?php echo $config['takecash_state'] ?>;
        if(ts==1){
            alert('<?php echo $config['takecash_msgtip'] ?>');
            return false;
        };
        var tn=<?php echo date('H') ?>;
        if(tn<tf || tn>tt){
            layer.msg('请在 '+tf+'点至 '+tt+'点之间申请提现，其他时间暂不能申请提现!',{icon:2});
            return false;
        };
        var money=$.trim($('[name=money]').val());
        if (isNaN(money)){
            layer.msg('提现金额必须为数字哦！',{icon:2});
            return false;
        }
        if(money=='' || money<=0){
            layer.msg('请输入申请大于0的结算金额',{icon:2});
            $('[name=money]').focus();
            return false;
        };

        <?php if($config['takecash_min']>0): ?>
        var takecash=<?php echo $config['takecash_min'] ?>;
        if(money<takecash){
            layer.msg('平台最低提现金额为'+takecash+'元！',{icon:2});
            $('[name=money]').focus();
            return false;
        };
        <?php endif; ?>
        if(money><?php echo $apply_money ?>){
            layer.msg('提现金额不得大于可提现金额',{icon:2});
            $('[name=money]').focus();
            return false;
        };
        return true;
    };
</script>
</body>
</html>
